<template>
  <weex-amap class="map" id="map2017" scale="true" geolocation="true" :center="pos">
    <weex-amap-marker v-for="(point, index) in markers"
                      :key="'point' + index"
                      :position="point.position"
                      :title="point.title"></weex-amap-marker>
  </weex-amap>
</template>
<script>
// const amap = weex.requireModule('amap')
// amap.initAmap('c62933bc6cecda1ddaf3f404ff9374f3')

export default {
  name: 'runMap',
  data () {
    return {
      pos:[116.487, 40.00003],
      point: {
        position: [112,36],
        title: 'this is a marker'
      },
      markers: []
    }
  },
  mounted () {
    setTimeout(() => {
      this.markers = [
        { position: [116.451805, 39.930004] },
        { position: [116.280000, 39.850000] }
      ]
      let x = (116.451805 + 116.280000) / 2
      let y = (39.930004 + 39.850000) / 2
      this.pos = [x, y]
    }, 3000)
  },
  beforeCreate () {
    this.$navigator.setLeftItem({
      text: '   ',
      fontSize: '40',
      fontWeight: 'bold'
    }, () => {
      this.$router.back()
    })
  }
}

</script>
<style scoped>
</style>
